const { defineConfig } = require("@vue/cli-service");
const path = require("path");

function resolve(paths) {
  return path.resolve(paths);
}

module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,
  devServer: {
    port: 5050,
    proxy: {
      "/api": {
        target: "http://chst.vip:1902",
        pathRewrite: { "^/api": "" },
      },
    },
  },
  chainWebpack: (config) => {
    config.resolve.alias
      .set("&", resolve("src"))
      .set("assets", resolve("src/assets"))
      .set("components", resolve("src/components"))
      .set("layout", resolve("src/layout"))
      .set("base", resolve("src/base"))
      .set("static", resolve("src/static"));
  },
});
